#ifndef __core_control_h__
#define __core_control_h__

#include "core/widget.h"

namespace core
{
    class StControl : public StWidget
    {
    public:
        StControl();
        ~StControl();

        virtual bool IsContainer();
        virtual StObject* Clone();
        virtual void Drop();
        virtual StWidget* HitTest(int x, int y);

    protected:
        BEGIN_MESSAGE_MAP()
            MESSAGE_HANDLE(ST_LAYOUT,      OnLayout     )
            MESSAGE_HANDLE(ST_PAINT,       OnPaint      )
            MESSAGE_HANDLE(ST_MOUSEHOVER,  OnMouseHover )
            MESSAGE_HANDLE(ST_MOUSELEAVE,  OnMouseLeave )
            MESSAGE_HANDLE(ST_LBUTTONDOWN, OnLButtonDown)
            MESSAGE_HANDLE(ST_LBUTTONUP,   OnLButtonUp  )
            MESSAGE_HANDLE(ST_MOUSEWHEEL,  OnMouseWheel )
            MESSAGE_HANDLE(ST_RBUTTONDOWN, OnRButtonDown)
            MESSAGE_HANDLE(ST_RBUTTONUP,   OnRButtonUp  )
            MESSAGE_HANDLE(ST_KEYDOWN,     OnKeyDown    )
            MESSAGE_HANDLE(ST_KEYUP,       OnKeyUp      )
            MESSAGE_HANDLE(ST_CHAR,        OnChar       )
        END_MESSAGE_MAP()

        LRESULT OnLayout      (WPARAM, LPARAM, bool*);
        LRESULT OnPaint       (WPARAM, LPARAM, bool*);
        LRESULT OnMouseHover  (WPARAM, LPARAM, bool*) { return 0; }
        LRESULT OnMouseLeave  (WPARAM, LPARAM, bool*) { return 0; }
        LRESULT OnLButtonDown (WPARAM, LPARAM, bool*) { return 0; }
        LRESULT OnLButtonUp   (WPARAM, LPARAM, bool*) { return 0; }
        LRESULT OnMouseWheel  (WPARAM, LPARAM, bool*) { return 0; }
        LRESULT OnRButtonDown (WPARAM, LPARAM, bool*) { return 0; }
        LRESULT OnRButtonUp   (WPARAM, LPARAM, bool*) { return 0; }
        LRESULT OnKeyDown     (WPARAM, LPARAM, bool*) { return 0; }
        LRESULT OnKeyUp       (WPARAM, LPARAM, bool*) { return 0; }
        LRESULT OnChar        (WPARAM, LPARAM, bool*) { return 0; }

    private:
        DISABLE_COPY_AND_ASSIGN(StControl)
    };
}

#endif